import { defineStore } from 'pinia';
import { config } from "@/assets/js/config";

export const useTranslateLangStore = defineStore('translateLang', {
    state: () => {
        return {
            //输入源语言
            sourceLang: 'zh',
            //翻译目标语言
            targetLang: config.targetLang
        };
    },
    getters: {},
    actions: {
        //切换翻译语言
        switchTranslateLang(currentSourceLang: string, currentTargetLang: string) {
            this.sourceLang = currentTargetLang;
            this.targetLang = currentSourceLang;
        }
    }
});
